//
//  WestViewController.m
//  Astro
//
//  Created by ACER on 11/29/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import "WestViewController.h"
#import "HoroscopeSelector.h"
#import "LuckyNumberViewController.h"
#import "DailyViewController.h"


@implementation WestViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad {
    [super viewDidLoad];
	self.title = @"West";		
    
	AstroAppDelegate *appDelegate = APP_DELEGATE;
	self.navigationItem.rightBarButtonItem = appDelegate.mainButtonItem;
}

- (void) action{
	NSLog(@"abcxyz");
}

- (void) viewWillAppear:(BOOL)animated{
	[self.navigationController setNavigationBarHidden:NO animated:YES];
	AstroAppDelegate *appDelegate = APP_DELEGATE;
	[appDelegate bottomButtonControlWithState:BBStateShowAbout andType:BBTypeWest];
	appDelegate = nil;
	
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

//======================================================
- (IBAction)clickHoroscopeBtn:(id)sender {
    UIButton *btn = (UIButton*)sender;
    HoroscopeSelector *viewHoroscopeSelected = [[HoroscopeSelector alloc] initWithNibName:@"HoroscopeSelector" bundle:nil withHoroscopeSelected:btn.tag + 1];   
    [self.navigationController pushViewController:viewHoroscopeSelected animated:YES];
}

//--------------
- (IBAction)clickLuckyNumber {
	LuckyNumberViewController *viewLuckyNumber = [[LuckyNumberViewController alloc] initWithNibName:@"LuckyNumberViewController" bundle:nil];   
    [self.navigationController pushViewController:viewLuckyNumber animated:YES];
}

- (IBAction)clickDaily {
	DailyViewController *viewDaily = [[DailyViewController alloc] initWithNibName:@"DailyViewController" bundle:nil];   
    [self.navigationController pushViewController:viewDaily animated:YES];
}



@end
